using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;

namespace Util.Excel
{
    public interface IExcelAssistant
    {
        /// <summary>
        /// 把实体列表转抱成Excel流
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="source"></param>
        Stream Collection2ExcelStream<T>(List<T> source, string sheetName) where T : class, new();

        /// <summary>
        /// 把实体列表转抱成Excel流
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="source"></param>
        Task<Stream> Collection2ExcelStreamAsync<T>(List<T> source, string sheetName) where T : class, new();

        /// <summary>
        /// 把实体列表转换成Excel字节
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="source"></param>
        /// <param name="sheetName"></param>
        /// <returns></returns>
        byte[] Collection2ExcelBytes<T>(List<T> source, string sheetName) where T : class, new();

        /// <summary>
        /// 把实体列表转换成Excel字节
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="source"></param>
        /// <param name="sheetName"></param>
        /// <returns></returns>
        Task<byte[]> Collection2ExcelBytesAsync<T>(List<T> source, string sheetName) where T : class, new();
    }
}
